/**
 * This class contains unit tests for validating the behavior of Apex classes
 * and triggers.
 *
 * Unit tests are class methods that verify whether a particular piece
 * of code is working properly. Unit test methods take no arguments,
 * commit no data to the database, and are flagged with the testMethod
 * keyword in the method definition.
 *
 * All test methods in an organization are executed whenever Apex code is deployed
 * to a production organization to confirm correctness, ensure code
 * coverage, and prevent regressions. All Apex classes are
 * required to have at least 75% code coverage in order to be deployed
 * to a production organization. In addition, all triggers must have some code coverage.
 * 
 * The @isTest class annotation indicates this class only contains test
 * methods. Classes defined with the @isTest annotation do not count against
 * the organization size limit for all Apex scripts.
 *
 * See the Apex Language Reference for more information about Testing and Code Coverage.
 */
@isTest
private class ctlr_GeneratePerformaInvoice_Test {

    static testMethod void myUnitTest()
    {
        // TO DO: implement unit test
        
        //Account Object Record...
        Account accountObject = new Account();
        accountObject.Name = 'Test Account';
        //accountObject.LicenseNumber__c = serialObject.id;
        accountObject.License_Application_Step__c = 'Record Created';
        accountObject.License_Application_Type__c = 'New License';
        accountObject.Activity__c = 'Trading - Three Activity';
        accountObject.License_Issue_Date__c = system.today();
        accountObject.License_Expiry_Date__c = System.Today().addYears(1);
        insert accountObject;
        
        
        //For Fees Object Records....
        Fee__c feeObject2 = new Fee__c();
        feeObject2.Name = 'Amendment - Change Activity';
        feeObject2.Fee_Type__c = 'Amendment - Change Activity';
        feeObject2.Price__c = 500;
        insert feeObject2;
        
        //For Suspension Object Records...
        Fines__c fineObject = new Fines__c();
        fineObject.Issue_Date__c = System.today();
        fineObject.Account__c = accountObject.id;
        fineObject.Fine_Type__c = 'Fix Amount';
        fineObject.Fine_Amount__c = 1000;
        fineObject.Fines_Included__c = true;
        fineObject.Status__c = 'Approved';
        insert fineObject;
        
        //Map<string,RecordType> amendmentRecordTypeMap = new Map<string,RecordType>([SELECT Id,SObjectType,DeveloperName,IsActive FROM RecordType where SObjectType =: 'Amendment__c' And DeveloperName IN('Company_Amendment_Change_Company_Name','Company_Amendment_Change_License_Type','Shareholder_Amendment_Add_Partner')]);
        Map<string,String> amendmentRecordTypeMap = new Map<string,String>();
        for(RecordType tempObject : [SELECT Id,SObjectType,Name,DeveloperName,IsActive FROM RecordType where SObjectType =: 'Amendment__c' And DeveloperName IN('Company_Amendment_Change_Company_Activity')])
        {
        	amendmentRecordTypeMap.put(tempObject.DeveloperName, tempObject.Name);
        	
        }
        
        
        //Now Setting the Values...
        ApexPages.StandardController accountExtendedObject = new ApexPages.StandardController(accountObject);
        ApexPages.CurrentPage().getParameters().put('id',accountObject.id);
        ApexPages.CurrentPage().getParameters().put('recordTypeName',amendmentRecordTypeMap.get('Company_Amendment_Change_Company_Activity'));
        
        
        //For ctlr_GeneratePerformaInvoice Class Test Coverage...
        //ctlr_GeneratePerformaInvoice generatePerformaClass = new ctlr_GeneratePerformaInvoice(accountExtendedObject);
        ctlr_GeneratePerformaInvoice generatePerformaClass = new ctlr_GeneratePerformaInvoice();
        PageReference result = generatePerformaClass.generatingPerformaInvoiceMethod();
        
        
    }
}